import { deleteRequest, downPostRequest, getRequest, postRequest, putRequest,getRequestRestFul } from '@/common/config/request';

import { SYS_BASE_URL } from "@/common/constant/Const";

export const roleListPaging = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/role/list-paging",data);
}

export const updateRole = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/role/update",data);
}

export const createRole = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/role/save",data);
}

export const deleteRole = (data) =>{
    return deleteRequest(SYS_BASE_URL + "/api/role/delete",data);
}
// 角色分配路由 
export const bindMenu = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/role/bindMenu",data);
}
// 角色分配权限  
export const bindResource = (data) =>{
    return postRequest(SYS_BASE_URL + "/api/role/bindResource",data);
}
// 获取角色路由 
export const getMenu = (data) =>{
    return getRequest(SYS_BASE_URL + "/api/role/getMenu/"+data);
}
// 获取角色权限  
export const getResource = (data) =>{
    return getRequest(SYS_BASE_URL + "/api/role/getResource/"+data);
}